package com.easy.base.model;

import java.sql.Timestamp;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import com.easy.core.dbHandle.entity.BaseEntity;

/**
 * 描述：管理员
 * @package com.easy.base.model
 * @class Operator
 */
@Entity
@Table(name = "BASE_OPRATOR")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class Operator extends BaseEntity {
	
	private static final long serialVersionUID = 1L;
	
	public static final int 		GENDER_MALE = 1;											//男
	public static final int 		GENDER_FEMALE = 0;										//女
	public static final Timestamp	CURRENT_TIME = new Timestamp(System.currentTimeMillis());	//当前时间
	public static final String		STATUS_ENABLE = "正常";		//正常
	public static final String 		STATUS_DISENABLE = "禁用";	//禁用
	public static final String 		STATUS_DIMISSION = "离职";	//离职
	
	@Id
	@GeneratedValue
	private @Column(name="ID")  			Long		id;
	private @Column(name="ACCOUNT") 		String 		account;					//账号
	private @Column(name="PASSWORD") 		String 		password;					//密码
	private @Column(name="FULLNAME") 		String 		fullName;					//全名
	private @Column(name="GENDER")   	 	Integer 	gender = GENDER_MALE;		//性别
	private @Column(name="BIRTHDATE") 		String 		birth;						//出生年月日
	private @Column(name="EMAIL") 			String 		email;						//邮件
	private @Column(name="ORG_NO") 			String 		orgNo;						//所属部门，主部门，可以有多个部门，但是必须有一个主部门
//	private Organization 	org;						//所属部门
	private @Column(name="POSITION_CODE") 	String 		positionCode;				//所属岗位，主职位，一个人可以有多个岗位，但是必须有一个主职
//	private Position		pos;						//所属主职
	private @Column(name="PHONE") 			String 		telphone;					//电话
	private @Column(name="MOBILE") 			String		mobile;						//手机
	private @Column(name="FAX") 			String 		fax;						//传真
	private @Column(name="ADDRESS") 		String 		address;					//地址
	private @Column(name="ZIP") 			String 		postCode;					//邮编
	private @Column(name="PHOTO") 			String 		photoPath;					//相片
	private @Column(name="ADD_DATE") 		Timestamp 	addDate = CURRENT_TIME;		//创建时间
	private @Column(name="STATUS") 			String 		status = STATUS_ENABLE;		//状态：1=正常，0=禁用，2=离职
	
	public String getAccount() {
		return account;
	}
	public void setAccount(String account) {
		this.account = account;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	public String getFullName() {
		return fullName;
	}
	public void setFullName(String fullName) {
		this.fullName = fullName;
	}
	public String getBirth() {
		return birth;
	}
	public void setBirth(String birth) {
		this.birth = birth;
	}
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	public String getOrgNo() {
		return orgNo;
	}
	public void setOrgNo(String orgNo) {
		this.orgNo = orgNo;
	}
	public String getPositionCode() {
		return positionCode;
	}
	public void setPositionCode(String positionCode) {
		this.positionCode = positionCode;
	}
	public String getTelphone() {
		return telphone;
	}
	public void setTelphone(String telphone) {
		this.telphone = telphone;
	}
	public String getMobile() {
		return mobile;
	}
	public void setMobile(String mobile) {
		this.mobile = mobile;
	}
	public String getFax() {
		return fax;
	}
	public void setFax(String fax) {
		this.fax = fax;
	}
	public String getAddress() {
		return address;
	}
	public void setAddress(String address) {
		this.address = address;
	}
	public String getPostCode() {
		return postCode;
	}
	public void setPostCode(String postCode) {
		this.postCode = postCode;
	}
	public String getPhotoPath() {
		return photoPath;
	}
	public void setPhotoPath(String photoPath) {
		this.photoPath = photoPath;
	}
	public Timestamp getAddDate() {
		return addDate;
	}
	public void setAddDate(Timestamp addDate) {
		this.addDate = addDate;
	}
	public String getStatus() {
		return status;
	}
	public void setStatus(String status) {
		this.status = status;
	}
	public Integer getGender() {
		return gender;
	}
	public void setGender(Integer gender) {
		this.gender = gender;
	}
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
}
